package top.lidee.module.backendApi.controller;

import cn.hutool.core.map.MapUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.NonNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import top.lidee.common.Constants;
import top.lidee.common.dto.AccountDto;
import top.lidee.common.dto.AccountInfo;
import top.lidee.common.dto.RoleDto;
import top.lidee.common.service.AccountService;
import top.lidee.common.service.DutyService;
import top.lidee.common.service.MerchantService;
import top.lidee.common.service.StoreService;
import top.lidee.common.service.twice.management.BmsManagerService;
import top.lidee.common.service.twice.popularize.PtpBeesInfoService;
import top.lidee.common.util.CommonUtil;
import top.lidee.common.util.TokenUtil;
import top.lidee.framework.exception.BusinessCheckException;
import top.lidee.framework.pagination.PaginationRequest;
import top.lidee.framework.pagination.PaginationResponse;
import top.lidee.framework.web.BaseController;
import top.lidee.framework.web.ResponseObject;
import top.lidee.module.aggregat.service.ClientAggregatService;
import top.lidee.repository.model.MtMerchant;
import top.lidee.repository.model.MtStore;
import top.lidee.repository.model.TAccount;
import top.lidee.repository.model.TDuty;
import top.lidee.repository.model.twice.pojo.management.BmsManagerEntity;
import top.lidee.repository.model.twice.pojo.popularize.PtpBeesInfoEntity;
import top.lidee.utils.StringUtil;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;

/**
 * 后台管理员管理
 * <p>
 * Created by FSQ
 * CopyRight https://www.lidee.top
 */
@Api(tags = "管理端-管理员相关接口")
@RestController
@AllArgsConstructor
@RequestMapping(value = "/backendApi/aggregate")
public class BackendAggreationController extends BaseController {

    @Autowired
    private ClientAggregatService aggregatService;

    /**
     * 单个应用授权 二维码生成
     * */
    @ApiOperation(value = "二维码下载")
    @RequestMapping(value = "/alipay/createQRcode/{code}", method = RequestMethod.POST)
    @CrossOrigin
    public ResponseObject alipayCreateAuthQRcode(@NonNull @PathVariable Integer code, HttpServletResponse response) throws IOException, InterruptedException {
        return aggregatService.createAuthQRcode(code,response);
    }





}